package com.le.controller;

import com.le.model.ApiResult;
import com.le.service.UserService;
import com.le.utils.ApiResultUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * @author liangyongle
 * @date 2018/8/14 0014
 */
@RestController
@RequestMapping("user")
@Slf4j
public class UserController {

   @Resource
   private UserService userService;

    @GetMapping("/getCustomer")
    public Map<String,Object> getCustomer(){

        Map<String,Object> list = userService.getCustomer();
        return list;
    }

    @GetMapping("/getList")
    public ApiResult getList(@RequestParam("code") String code){
        Map<String,Object> list = new HashMap<>();
        list.put("name","测试");
        list.put("code",code);
        log.info("list:{}",list);
        return ApiResultUtil.ok(list);
    }
}
